<template>
	<view class="course_item" @tap.stop="goDetails">
		<view class="course_item_left">
			<image :src='item.thumb' mode="aspectFill"></image>
		</view>
		<view class="course_item_right">
			<view class="course_item_right_1">{{item.name}}</view>
			<view class="course_item_right_2" v-if="item.label.length">
				<view class="course_item_right_2_1" v-for="(v, k) in item.label">
					{{v}}
				</view>
			</view>
			<view class="price">
				<text class="price_1">￥</text>
				<text class="price_2">{{item.price}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				type: Object,
				default: function() {
					return {}
				}
			}
		},
		data() {
			return {
				
			}
		},
		created() {
			
		},
		methods: {
			goDetails() {
				uni.navigateTo({
					url: '/pages/shouye/oneAppointment/courseDetails?aid=' + this.item.aid + '&data_type=2'
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.course_item {
		background: #fff;
		border-radius: 16rpx;
		padding: 24rpx;
		margin-top: 20rpx;
		display: flex;
	
		.course_item_left {
			width: 160rpx;
			height: 160rpx;
	
			image {
				width: 100%;
				height: 100%;
				border-radius: 24rpx;
			}
		}
	
		.course_item_right {
			width: calc(100% - 180rpx);
			margin-left: 20rpx;
	
			.course_item_right_1 {
				font-size: 30rpx;
				text-overflow: ellipsis;
				overflow: hidden;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				-webkit-line-clamp: 1; /* 这里是超出几行省略 */
			}
			.course_item_right_2 {
				margin-top: 16rpx;
				overflow: hidden;
				.course_item_right_2_1 {
					float: left;
					color: #FD9E30;
					font-size: 20rpx;
					background: rgba(255,255,255,0.2);
					padding: 2rpx 16rpx;
					opacity: 1;
					border: 1px solid #FD9E30;
					border-radius: 35rpx;
					margin-right: 12rpx;
					margin-bottom: 8rpx;
				}
			}
			.price {
				color: #EA3D13;
				font-weight: bold;
				margin-top: 32rpx;
				.price_1 {
					font-size: 24rpx;
				}
				.price_2 {
					font-size: 32rpx;
				}
			}
		}
	}
</style>